package com.juochiu.springcloud.controller;

import com.juochiu.springcloud.service.SchedualHelloServices;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.client.discovery.DiscoveryClient;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * @ClassName HiController
 * @Description TODO
 * @Author zxqu
 * @Date 2018/11/8 15:07
 * @Version
 **/
@RestController
@RequestMapping(value = "/feign")
public class HiController {

    @Autowired
    DiscoveryClient discoveryClient;

    @Autowired
    SchedualHelloServices schedualHelloServices;

    @Value("${server.port}")
    String prot;

    @RequestMapping(value = "/hi",method = RequestMethod.GET)
    public String dc(String name){
        String services = "Services====:"+discoveryClient.getServices()+"---"+ schedualHelloServices.sayHello()+"=====prot:"+prot+"---"+name;
        System.out.println(services);
        return services;
    }
}
